

package com.liulishuo.filedownloader.i;

import com.liulishuo.filedownloader.message.MessageSnapshot;
import com.liulishuo.filedownloader.model.FileDownloadHeader;
import com.liulishuo.filedownloader.model.FileDownloadTaskAtom;
import ohos.event.notification.NotificationRequest;
import com.liulishuo.filedownloader.i.IFileDownloadIPCCallback;
import ohos.rpc.IRemoteBroker;
import ohos.rpc.RemoteException;

public interface IFileDownloadIPCService extends IRemoteBroker {

    void registerCallback(
        /* [in] */ IFileDownloadIPCCallback callback) throws RemoteException;

    void unregisterCallback(
        /* [in] */ IFileDownloadIPCCallback callback) throws RemoteException;

    boolean checkDownloading(
        /* [in] */ String url,
        /* [in] */ String path) throws RemoteException;

    void start(
        /* [in] */ String url,
        /* [in] */ String path,
        /* [in] */ boolean pathAsDirectory,
        /* [in] */ int callbackProgressTimes,
        /* [in] */ int callbackProgressMinIntervalMillis,
        /* [in] */ int autoRetryTimes,
        /* [in] */ boolean forceReDownload,
        /* [in] */ FileDownloadHeader header,
        /* [in] */ boolean isWifiRequired) throws RemoteException;

    boolean pause(
        /* [in] */ int downloadId) throws RemoteException;

    void pauseAllTasks() throws RemoteException;

    boolean setMaxNetworkThreadCount(
        /* [in] */ int count) throws RemoteException;

    long getSofar(
        /* [in] */ int downloadId) throws RemoteException;

    long getTotal(
        /* [in] */ int downloadId) throws RemoteException;

    byte getStatus(
        /* [in] */ int downloadId) throws RemoteException;

    boolean isIdle() throws RemoteException;

    void startForeground(
        /* [in] */ int id,
        /* [in] */ NotificationRequest notification) throws RemoteException;

    void stopForeground(
        /* [in] */ boolean removeNotification) throws RemoteException;

    boolean clearTaskData(
        /* [in] */ int id) throws RemoteException;

    void clearAllTaskData() throws RemoteException;
};

